/*
 * @Author: Wxx
 * @Date: 2022-03-01 16:20:35
 * @LastEditors: Wxx
 * @LastEditTime: 2022-03-01 16:29:24
 * @Description:
 */
import React, { Component } from "react";
import { createPortal } from "react-dom";

export default class PortalDialog extends Component {
  render() {
    return createPortal(
      <div
        style={{
          width: "100%",
          height: "100%",
          position: "fixed",
          left: 0,
          top: 0,
          background: "rgba(0,0,0, 0.8)",
          color: "#fff",
          display: "flex",
          justifyContent: "center",
          alignItems: "center",
        }}
        onClick={() => this.props.close()}
      >
        {this.props.children}
        正在加载中....
      </div>,
      document.body
    );
  }
}
